#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	int candidate[4] = { 0 };
	int vote = 0, abandoned = 0;
	while (scanf("%d", &vote))
	{
		if (vote == -1) break;
		else if (vote >= 1 && vote <= 3) candidate[vote]++;
		else abandoned++;
	}
	printf("%d %d %d %d\n", candidate[1], candidate[2], candidate[3], abandoned);
	return 0;
}